package org.bangumibuddy.pojo;

import lombok.Data;
import org.bangumibuddy.constant.DownloadStatus;
import org.bangumibuddy.utils.CommonUtils;

@Data
public class DownloadInfo {
    private String torrentName;
    private String hash;
    private String url;
    private Long estimatedTime = 0L;
    private Long downloadedSize = 0L;
    private Long totalSize;
    private Long downloadSpeed = 0L;
    private DownloadStatus status = DownloadStatus.UNKNOWN;

    public String getTotalSizeString() {
        return CommonUtils.formatSize(totalSize);
    }

    public String getDownloadedSizeString() {
        return CommonUtils.formatSize(downloadedSize);
    }

    public String getDownloadSpeedString() {
        return CommonUtils.formatSize(downloadSpeed) + "/s";
    }

    public String getEstimatedTimeString() {
        return CommonUtils.formatTime(estimatedTime);
    }
}
